package com.jakx.controller;

import com.alibaba.fastjson.JSONObject;
import com.jakx.service.AccountServiceImpl;
import com.jakx.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.xml.ws.soap.Addressing;
import java.io.File;
import java.util.Date;

@RestController("/aaa")
public class DemoController {

    @Autowired
    private DemoService demoService;

    @Autowired
    private AccountServiceImpl accountService;

    @ResponseBody
    @RequestMapping(value = "/demo", method = RequestMethod.GET, produces = "text/plain")
    public String test() {
        JSONObject json = new JSONObject();
        json.put("name","yinpeng");
        json.put("passwd","qwe123!@#");
        demoService.test();
        demoService.test1();
        return json.toJSONString();
    }

    @ResponseBody
    @RequestMapping(value = "/acc", method = RequestMethod.GET, produces = "text/plain")
    public String acc(@RequestParam(required = false) String pv) {
        // http头，基本参数验证
        accountService.reg(pv);
        return "hhhh";
    }
}
